import Tabbar from '@/components/Tabbar';

const Home = () => import('@/views/Home');
const Category = () => import('@/views/Category');
const Cart = () => import('@/views/Cart');
const Mine = () => import('@/views/Mine');
const Detail = () => import('@/views/Detail');

const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    name: 'home',
    components: {
      default: Home,
      tabbar: Tabbar,
    },
    icon: 'home',
    title: '首页',
  },
  {
    path: '/category',
    name: 'category',
    icon: 'mall',
    components: {
      default: Category,
      tabbar: Tabbar,
    },
    title: '分类',
  },
  {
    path: '/detail/:id',
    name: 'detail',
    component: Detail,
  },
  {
    path: '/cart',
    name: 'cart',
    icon: 'cart',
    components: {
      default: Cart,
      tabbar: Tabbar,
    },
    title: '购物车',
  },
  {
    path: '/mine',
    name: 'mine',
    icon: 'mine',
    components: {
      default: Mine,
      tabbar: Tabbar,
    },
    title: '我的',
  },
];

export default routes;
